Class Objects.Static
Represents a static object in the game world.
Functions
| Static:GetName() | Get this static's unique string identifier. |
| Static:GetSlot() | Get this static's slot ID. |
| Static:GetPosition() | Get this static's world position. |
| Static:GetRotation() | Get this static's world rotation. |
| Static:GetScale() | Get this static's world scale. |
| Static:GetColor() | Get this static's color. |
| Static:GetHP() | Get this static's hit points. |
| Static:GetActive() | Get this static's visibility status. |
| Static:GetCollidable() | Get this static's collision status. |
| Static:GetSolid() | Get this static's solid collision status. |
| Static:SetName(name) | Set this static's unique identifier string. |
| Static:SetSlot(slotID) | Set this static's slot ID. |
| Static:SetPosition(pos) | Set this static's world position. |
| Static:SetRotation(rot) | Set this static's rotation. |
| Static:SetScale(scale) | Set this static's world scale. |
| Static:SetColor(color) | Set this static's color. |
| Static:SetHP(hitPoints) | Set this static's hit points. |
| Static:SetSolid(status) | Set this static's solid collision status. |
| Static:SetCollidable(collidable) | Set this static's collision status. |
| Static:GetProperty(name) | Get a property value. |
| Static:SetProperty(name, value) | Set a property value. |
| Static:HasInstanceProperty(name) | Check if a property value was individually set for a given static mesh instance. |
| Static:Enable() | Enable this static. |
| Static:Disable() | Disable this static. |
| Static:Shatter() | Shatter this static. |
Functions
- Static:GetName()
-
Get this static's unique string identifier.
Returns:
-
string
Name string.
- Static:GetSlot()
-
Get this static's slot ID.
Returns:
-
int
Slot ID.
- Static:GetPosition()
-
Get this static's world position.
Returns:
-
Vec3
World position.
- Static:GetRotation()
-
Get this static's world rotation.
Returns:
-
Rotation
World rotation.
- Static:GetScale()
-
Get this static's world scale.
Returns:
-
Vec3
World scale.
- Static:GetColor()
-
Get this static's color.
Returns:
-
Color
Color.
- Static:GetHP()
-
Get this static's hit points. Used only with shatterable statics.
Returns:
-
int
Hit points.
- Static:GetActive()
-
Get this static's visibility status.
Returns:
-
bool
Status. true means visible, false otherwise.
- Static:GetCollidable()
-
Get this static's collision status.
Returns:
-
bool
Collision status. true if can be collided with, false otherwise.
- Static:GetSolid()
-
Get this static's solid collision status.
Returns:
-
bool
Solid Status. true if solid, false if soft.
- Static:SetName(name)
-
Set this static's unique identifier string.
Parameters:
- name string New name.
- Static:SetSlot(slotID)
-
Set this static's slot ID.
Parameters:
- slotID int New slot ID.
- Static:SetPosition(pos)
-
Set this static's world position.
Parameters:
- pos Vec3 New world position.
- Static:SetRotation(rot)
-
Set this static's rotation.
Parameters:
- rot Rotation New rotation.
- Static:SetScale(scale)
-
Set this static's world scale.
Parameters:
- scale Vec3 New world scale.
- Static:SetColor(color)
-
Set this static's color.
Parameters:
- color Color New color.
- Static:SetHP(hitPoints)
-
Set this static's hit points. Used only with shatterable statics.
Parameters:
- hitPoints int New hit points.
- Static:SetSolid(status)
-
Set this static's solid collision status.
Parameters:
- status bool New status, true is solid, false is soft.
- Static:SetCollidable(collidable)
-
Set this static's collision status.
Parameters:
- collidable bool New collision status. true if can be collided with, false: no collision.
- Static:GetProperty(name)
-
Get a property value.
Tries to get an instance property first, then falls back to global slot property. Returns nil if the property does not exist.
Parameters:
- name string The property name.
Returns:
-
any
The property value, or nil if not set. You can use Type module functions to determine return value type.
- Static:SetProperty(name, value)
-
Set a property value.
Will be set only for this static mesh instance. If property does not exist, creates it.
If value is nil, the instance property is removed. Does not affect global slot property set by Objects.SetStaticProperty.
Parameters:
- Static:HasInstanceProperty(name)
-
Check if a property value was individually set for a given static mesh instance.
Parameters:
- name string The property name.
Returns:
-
bool
True if an instance property exists.
- Static:Enable()
- Enable this static. Used when previously shattered disabled manually.
- Static:Disable()
- Disable this static.
- Static:Shatter()
- Shatter this static.
